//
//  Toolbar.swift
//  myhub
//
//  Created by x on 2024/6/3.
//

import UIKit
import XDesignKit

open class Toolbar: UIToolbar {

    public override init(frame: CGRect) {
        super.init(frame: frame)
        makeUI()
    }

    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        makeUI()
    }

    open func makeUI() {
        isTranslucent = false

        theme.barStyle = themeService.attribute { $0.barStyle }
        theme.barTintColor = themeService.attribute { $0.primaryDark }
        theme.tintColor = themeService.attribute { $0.secondary }

        snp.makeConstraints { (make) in
            make.height.equalTo(Dimensions.tableRowHeight)
        }
    }
}
